<template>
	<view class="apply" v-if="onApply">
		<image class="apply_img" :src="zhuboInfo.user.avatarUrl" />
		<text class="apply_title">{{zhuboInfo.user.nickName}}申请与您连麦</text>
		<view class="apply_btns">
			<text class="apply_btn1" @tap="close">拒绝连麦</text>
			<text class="apply_btn2 text-white" @tap="acceptApply">同意连麦</text>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			'onApply': {
				type: Boolean,
				default: true
			},
			// 'zhuboInfo': {
			// 	type: Object,
			// 	default: {}
			// },
			'info': {
				type: Object,
				default: {}
			}
		},
		data() {
			return {
zhuboInfo:{}
			}
		},
		methods: {
			async close() {
				console.log(this.info);
				const res = await uni.$api.live.userListSend({
					live_id: this.info.id
				})
				console.log(res, 'xxxxxxxxxx');
				this.$emit("closeApply")
			},
			async acceptApply() {
				const res = await uni.$api.live.lienmaiuser({
					live_id: this.info.id
				})
				this.$emit("acceptApply")
			},
		}
	}
</script>

<style scoped lang="scss">
	.text-white {
		color: #fff;
	}

	// 申请连麦
	.apply {
		width: 600rpx;
		height: 350rpx;
		background-color: #fff;
		position: fixed;
		top: 500rpx;
		left: 75rpx;
		border-radius: 15rpx;
		display: flex;
		flex-direction: column;
	}

	.apply_img {
		width: 150rpx;
		height: 150rpx;
		border-radius: 75rpx;
		text-align: center;
		line-height: 150rpx;
		background-color: greenyellow;
		position: fixed;
		top: 430rpx;
		;
		left: 300rpx;
	}

	.apply_title {
		width: 600rpx;
		height: 220rpx;
		line-height: 280rpx;
		text-align: center;
	}

	.apply_btns {
		display: flex;
		flex-direction: row;
		justify-content: space-around;
	}

	.apply_btn1 {
		height: 100rpx;
		width: 250rpx;
		border-radius: 50rpx;
		line-height: 100rpx;
		text-align: center;
		color: rgb(154, 151, 157);
		background-color: rgb(229, 229, 229);
	}

	.apply_btn2 {
		height: 100rpx;
		width: 250rpx;
		border-radius: 50rpx;
		line-height: 100rpx;
		text-align: center;
		background: linear-gradient(to right, #4fb784, #a4d79f);
	}
</style>